Skip to content

feat(messages): add send_at per-message scheduling (cueapi #623 parity)#34

Merged
mikemolinet merged 1 commit into
mainfrom
feat/messages-send-at
May 9, 2026
Merged

feat(messages): add send_at per-message scheduling (cueapi #623 parity)#34
mikemolinet merged 1 commit into
mainfrom
feat/messages-send-at

Conversation

@mikemolinet
Copy link
Copy Markdown
Collaborator

Summary

Adds send_at to MessagesResource.send(), covering server PR #623 (per-message scheduling).

Caller can now schedule message delivery to a specific timestamp instead of always-immediate:

client.messages.send(
    from_agent="sender@you",
    to="recipient@me",
    body="hi",
    send_at="2030-01-01T12:00:00Z",   # str
)

# or with a datetime:
from datetime import datetime, timezone
client.messages.send(
    from_agent="sender@you",
    to="recipient@me",
    body="hi",
    send_at=datetime(2030, 1, 1, 12, 0, tzinfo=timezone.utc),
)

Implementation notes

  • Optional[Union[str, datetime]] — auto-serialized via .isoformat() (same convention as cues.create(at=...) and the new cues.fire(send_at=...) from PR feat(cues): add send_at + exit_criteria + idempotency_key to fire() #33).
  • Sent as a body field, not a header — matches the server contract.
  • Backwards compatible: defaults to None, omitted from the request body when unset. Existing call sites unchanged.

Tests

3 new mock-based tests in test_messages_resource.py::TestSendAt (matches existing test style in this file — asserts on the request body shape rather than against staging):

  1. test_send_with_send_at_iso_string — ISO string flows verbatim
  2. test_send_with_send_at_datetime_auto_isoformats — datetime → ISO 8601 with tz preserved
  3. test_send_without_send_at_omits_field — unset means field NOT in body

Source

Drift audit handoff/cueapi-package-drift-2026-05-06. Backlog row "Parity port: PR #623 (POST /v1/messages send_at) → cueapi-python" (p1, CTO-SEC-DRIFT-AUDIT-AUTHORIZE 2026-05-06).

Related

Test plan

  • All 3 new tests pass via mock
  • No regressions in existing TestSend tests
  • Pyright clean once it picks up the new signature

🤖 Generated with Claude Code

Adds the optional ``send_at`` kwarg to ``MessagesResource.send()``,
covering server PR #623 (POST /v1/messages send_at). Caller can now
schedule per-message delivery instead of always-immediate.

Accepts ``str`` (ISO 8601) or ``datetime`` — auto-serialized via
``.isoformat()`` (same convention as ``cues.create(at=...)`` and the
new ``cues.fire(send_at=...)`` from PR #33).

Body field, not header (matches the server contract).

Backwards compatible — defaults to None, omitted from the request body
when unset; existing call sites unchanged.

3 new mock-based tests in test_messages_resource.py::TestSendAt
(matches existing test style in this file: assert on the request body
shape rather than against staging):

  - send_at as ISO 8601 string flows verbatim
  - send_at as datetime auto-isoformats with tz
  - send_at unset omits field from body entirely

Source: drift audit handoff/cueapi-package-drift-2026-05-06; Backlog
row "Parity port: PR #623 (POST /v1/messages send_at) → cueapi-python"
(p1, CTO-SEC-DRIFT-AUDIT-AUTHORIZE 2026-05-06).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@govindkavaturi-art govindkavaturi-art enabled auto-merge (squash) May 7, 2026 00:39
@mikemolinet mikemolinet merged commit 39751e5 into main May 9, 2026
4 checks passed
@mikemolinet mikemolinet deleted the feat/messages-send-at branch May 9, 2026 21:07
mikemolinet added a commit that referenced this pull request May 9, 2026
…t recent ports (#36)

Manifest was 3 days stale; many endpoints listed as missing have
been ported since the last audit.

Moved from endpoints_missing → endpoints_covered (with PR refs):

  - POST /v1/cues/{id}/fire (PR #23; in-flight kwargs in #33)
  - POST /v1/executions/{id}/replay (PR #25)
  - GET /v1/executions/claimable (PR #23)
  - POST /v1/executions/{id}/claim (PR #23)
  - POST /v1/executions/claim (PR #23)
  - GET /v1/workers + DELETE /v1/workers/{id} (PR #26)
  - GET /v1/usage (PR #26)
  - POST /v1/agents + GET/PATCH/DELETE /v1/agents/{ref}
    + GET /v1/agents/{ref}/webhook-secret
    + GET /v1/agents/{ref}/inbox + /sent (PR #27)
  - POST /v1/messages + GET/read/ack (PR #28)

Added in-flight refs (open PRs):

  - GET /v1/agents/roster (in-flight PR #35; cueapi #630 parity)
  - GET /v1/agents/{ref}/presence (in-flight PR #35; cueapi #662 parity)
  - send_at + exit_criteria + idempotency_key kwargs on fire (PR #33)
  - send_at kwarg on messages.send (PR #34)

New endpoints_missing items (post-audit):

  - POST /v1/agents/{ref}/webhook-secret/regenerate (destructive; tracked)
  - DELETE /v1/messages bulk (cueapi #650; bounded by cueapi-cli upstream)
  - POST /v1/executions/{id}/live-claim (cueapi #664; handler-runtime, not SDK)

New "in_flight_ports_2026_05_07" section listing all 4 currently-open
SDK PRs with PR-overlap notes (PR #30/#33 lane-flagged with cueapi-main).

Bumped sdk_version_at_audit 0.1.3 → 0.2.x.

This refresh closes the Backlog row "Refresh cueapi-python parity-manifest.json"
filed earlier today (Self-flag 2026-05-07).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant